package com.textanalyzer.util;

import java.util.List;

import org.junit.Assert;

/**
 * The assert class which includes useful test methods.
 * 
 */
public class Asserter {

	/**
	 * The method checks the given object is contained in a given list.
	 * 
	 * @param expectedObject
	 *            to be searched.
	 * @param actualList
	 *            List of Object.
	 */
	public void assertListContains(Object expectedObject,
			List<String> actualList) {
		// assign found is false
		boolean isFound = false;
		for (Object actualObject : actualList) {
			if (actualObject.equals(expectedObject)) {
				// if list have the given object .... make found true..
				isFound = true;
				break;
			}

		}
		// make fail if found is false;
		if (!isFound)
			Assert.fail("Given object is not contained given list.");
	}

}
